package cn.hxzy.course.mapper;

import cn.hxzy.common.domain.Section;
import cn.hxzy.common.domain.Video;
import cn.hxzy.common.domain.vo.SectionVo;
import cn.hxzy.common.response.R;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author niuyi
 * @since 2024-06-22
 */
@Mapper
public interface SectionMapper extends BaseMapper<Section> {


    /**
     * 根据小节名称模糊查询小节
     */
    @Select("select * from sys_section where section_name like '%${sectionName}%'")
    List<Section> getSectionByName(String sectionName);


    @Update("UPDATE sys_section SET section_name=#{sectionName} where section_id =#{sectionId}")
    int updateSectionName(@Param("sectionId") Integer sectionId,@Param("sectionName") String sectionName);
}
